<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>滑动门和边框图片做聊天气泡</title>

    <style>
        *{
            padding: 0;
            margin: 0;
        }

        h3{
            margin: 0px auto;
            margin-top: 100px;
        }

        .bg{
            width: 200px;
            height: 60px;
            background: red url("./Src/images/border/nav-center.jpg") repeat;
            margin: 0 auto;
        }

        .bg .left{
            width: 100%;
            height: 100%;
            background: url("./Src/images/border/nav-left.jpg") no-repeat;
        }

        .bg .right{
            width: 100%;
            height: 100%;
            background: url("./Src/images/border/nav-right.jpg") center right no-repeat;
        }

        .bgimg{
            margin: 0 auto;
            width: 200px;
            box-sizing: border-box;
            border: 20px solid #000;
            /*图片裁剪顺序 上右下左*/
            border-image: url("./Src/images/border/nav-all.jpg") 1 30 44 30 fill stretch;
            /*边框需要跟图片宽度一样才能显示正常(不缩放)*/
            border-width: 54px;
            overflow: hidden;
        }

        .bgimg>div{
            /*border: 20px solid #fff;*/
        }
    </style>
</head>
<body>
    <h3>滑动门</h3>

    <div class="bg">
        <div class="left">
            <div class="right">
                缺点:支持变宽 不支持变高
            </div>
        </div>
    </div>

    <h3>边框图片</h3>

    <div class="bgimg">

        <br>
    </div>

</body>
</html>